Skip to content

BED-9713: persist GitHub database IDs for OIDC subjects - #71

Merged
jaredcatkinson merged 3 commits into
mainfrom
feature/BED-9713-persist-github-database-ids
Sep 9, 2026
Merged

BED-9713: persist GitHub database IDs for OIDC subjects#71
jaredcatkinson merged 3 commits into
mainfrom
feature/BED-9713-persist-github-database-ids

Conversation

@jaredcatkinson

@jaredcatkinson jaredcatkinson commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • persist numeric GitHub database IDs on GH_Organization and GH_Repository nodes
  • preserve existing opaque GraphQL node IDs for graph identity and ownership relationships
  • document the new properties and add regression coverage for REST-derived IDs

Testing

  • uv run pytest tests/test_source_org_canonicalization.py tests/test_repository_rulesets.py tests/test_description_docs.py -q
  • uv run ruff check src/openhound_github/models/org.py src/openhound_github/models/repository.py src/openhound_github/resources/organization.py tests/test_repository_rulesets.py tests/test_source_org_canonicalization.py

Dependency

Summary by CodeRabbit

  • New Features

    • Organization and repository records now include numeric GitHub database IDs.
    • Repository data now includes the owner’s numeric database ID alongside existing owner metadata.
    • These identifiers are preserved when building organization, repository, and relationship data.
    • Organization role names now display with their organization-qualified name while retaining role-only values where appropriate.
  • Documentation

    • Updated organization and repository schemas to document the new database ID fields and owner metadata.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 552abccf-6749-4639-befa-661a9585f2b9

📥 Commits

Reviewing files that changed from the base of the PR and between 008fd24 and 8390738.

📒 Files selected for processing (9)
  • descriptions/nodes/GH_Organization.md
  • descriptions/nodes/GH_Repository.md
  • src/openhound_github/models/org.py
  • src/openhound_github/models/org_role.py
  • src/openhound_github/models/repository.py
  • src/openhound_github/resources/organization.py
  • tests/test_org_role_model.py
  • tests/test_repository_rulesets.py
  • tests/test_source_org_canonicalization.py

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


Walkthrough

The change adds numeric GitHub database IDs to organization and repository resources, models, and graph-node properties. It also separates repository owner node IDs from numeric IDs and qualifies organization role names consistently.

Changes

GitHub identity metadata and role naming

Layer / File(s) Summary
Identity metadata flow
descriptions/nodes/GH_Organization.md, descriptions/nodes/GH_Repository.md, src/openhound_github/models/org.py, src/openhound_github/models/repository.py, src/openhound_github/resources/organization.py, tests/test_repository_rulesets.py, tests/test_source_org_canonicalization.py
Organization and repository resources expose REST id values as database_id. Models and graph-node properties preserve repository, owner, and organization numeric IDs. Tests verify the mappings and organization-to-repository relationships.
Qualified organization role names
src/openhound_github/models/org_role.py, tests/test_org_role_model.py
OrgRole.name stores the role-only API name. as_node() uses the organization-qualified name for both name and displayname. Tests cover role node IDs and related members and teams.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 83907

This change persists GitHub numeric database IDs for organizations and repositories without replacing existing graph node IDs, enabling immutable OIDC-subject metadata with no identified merge-blocking risk.

Sequence Diagram(s)

sequenceDiagram
  participant GitHubRESTAPI
  participant OrganizationResource
  participant AssetModels
  participant GraphNodeProperties
  GitHubRESTAPI->>OrganizationResource: Return organization and repository id values
  OrganizationResource->>AssetModels: Set database_id fields
  AssetModels->>GraphNodeProperties: Propagate database IDs and owner metadata
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.52% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 7 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: persisting GitHub numeric database IDs for OIDC subjects. The issue identifier does not reduce clarity.
Full details: Docstring Coverage

Explanation

Docstring coverage is 9.52% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 7 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/BED-9713-persist-github-database-ids

A rabbit checks each numeric sign
Through nodes and owners in a tidy line
Roles gain names both short and clear
Tests watch the mappings appear
The graph now keeps its IDs near

Comment @coderabbitai help to get the list of available commands.

@jaredcatkinson
jaredcatkinson merged commit dc5db62 into main Sep 9, 2026
4 checks passed
@jaredcatkinson
jaredcatkinson deleted the feature/BED-9713-persist-github-database-ids branch September 9, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants